<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>NumCpp: Main Page</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="NumCppLogoDoxygen.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">NumCpp
   &#160;<span id="projectnumber">2.4.0</span>
   </div>
   <div id="projectbrief">A Templatized Header Only C++ Implementation of the Python NumPy Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('index.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="PageDoc"><div class="header">
  <div class="headertitle">
<div class="title">NumCpp Documentation</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p><img src="https://github.com/dpilger26/NumCpp/raw/master/docs/logo/NumCppLogo.png" alt="NumCpp logo" class="inline"/></p>
<p><a href="https://ci.appveyor.com/project/dpilger26/numcpp/branch/master"><img src="https://ci.appveyor.com/api/projects/status/slxre2j64qc8ubvl/branch/master?svg=true" alt="Build status" class="inline"/></a> <a href="https://travis-ci.org/dpilger26/NumCpp"><object type="image/svg+xml" data="https://travis-ci.org/dpilger26/NumCpp.svg?branch=master" style="pointer-events: none;">Build Status</object></a> <a href="https://app.codacy.com/manual/dpilger26/NumCpp?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=dpilger26/NumCpp&amp;utm_campaign=Badge_Grade_Dashboard"><img src="https://api.codacy.com/project/badge/Grade/ea24c08d892e4beebd46cfca260823c1" alt="Codacy Badge" class="inline"/></a></p>
<h1>NumCpp: A Templatized Header Only C++ Implementation of the <a href="http://www.numpy.org">Python NumPy Library</a></h1>
<h2>Author: David Pilger <a href="#" onclick="location.href='mai'+'lto:'+'dpi'+'lg'+'er2'+'6@'+'gma'+'il'+'.co'+'m'; return false;">dpilg<span style="display: none;">.nosp@m.</span>er26<span style="display: none;">.nosp@m.</span>@gmai<span style="display: none;">.nosp@m.</span>l.co<span style="display: none;">.nosp@m.</span>m</a></h2>
<h2>Version: <object type="image/svg+xml" data="https://img.shields.io/github/tag-date/dpilger26/NumCpp.svg?color=blue&amp;label=Official%20Release&amp;style=popout" style="pointer-events: none;">GitHub tag (latest by date)</object></h2>
<h2>License <a href="https://lbesson.mit-license.org/"><object type="image/svg+xml" data="https://img.shields.io/badge/License-MIT-blue.svg" style="pointer-events: none;">MIT license</object></a></h2>
<h2>Testing</h2>
<p><b>C++ Standards:</b> <br  />
 <a href="https://isocpp.org/std/the-standard"><object type="image/svg+xml" data="https://img.shields.io/badge/C%2B%2B-14-blue.svg" style="pointer-events: none;">C++14</object></a> <a href="https://isocpp.org/std/the-standard"><object type="image/svg+xml" data="https://img.shields.io/badge/C%2B%2B-17-blue.svg" style="pointer-events: none;">C++17</object></a> <a href="https://isocpp.org/std/the-standard"><object type="image/svg+xml" data="https://img.shields.io/badge/C%2B%2B-20-blue.svg" style="pointer-events: none;">C++20</object></a></p>
<p><b>Compilers:</b> <br  />
 Visual Studio: 2017, 2019 <br  />
 GNU: 6.5, 7.5, 8.4, 9.3, 10.1 <br  />
 Clang: 6, 7, 8, 9, 10 <br  />
</p>
<p><b>Boost Versions:</b> <br  />
 1.68+</p>
<h2><a href="https://dpilger26.github.io/NumCpp">Documentation</a></h2>
<h2><a href="https://github.com/dpilger26/NumCpp">GitHub</a></h2>
<h2><a href="https://dpilger26.github.io/NumCpp/doxygen/html/md__c_1__github__num_cpp_docs_markdown__installation.html">Installation</a></h2>
<h2><a href="https://dpilger26.github.io/NumCpp/doxygen/html/md__c_1__github__num_cpp_docs_markdown__building.html">Building</a></h2>
<h2><a href="https://dpilger26.github.io/NumCpp/doxygen/html/md__c_1__github__num_cpp_docs_markdown__release_notes.html">Release Notes</a></h2>
<h2>From NumPy To NumCpp – A Quick Start Guide</h2>
<p>This quick start guide is meant as a very brief overview of some of the things that can be done with <b>NumCpp</b>. For a full breakdown of everything available in the <b>NumCpp</b> library please visit the <a href="https://dpilger26.github.io/NumCpp">Full Documentation</a>.</p>
<h3>CONTAINERS</h3>
<p>The main data structure in <b>NumCpp</b> is the <code>NdArray</code>. It is inherently a 2D array class, with 1D arrays being implemented as 1xN arrays. There is also a <code>DataCube</code> class that is provided as a convenience container for storing an array of 2D <code>NdArray</code>s, but it has limited usefulness past a simple container.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b> </th><th class="markdownTableHeadCenter"><b>NumCpp</b>  </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>a = np.array([[1, 2], [3, 4], [5, 6]])</code> </td><td class="markdownTableBodyCenter"><code><a class="el" href="classnc_1_1_nd_array.html" title="Holds 1D and 2D arrays, the main work horse of the NumCpp library.">nc::NdArray</a>&lt;int&gt; a = { {1, 2}, {3, 4}, {5, 6} }</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>a.reshape([2, 3])</code> </td><td class="markdownTableBodyCenter"><code>a.reshape(2, 3)</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>a.astype(np.double)</code> </td><td class="markdownTableBodyCenter"><code>a.astype&lt;double&gt;()</code>  </td></tr>
</table>
<h3>INITIALIZERS</h3>
<p>Many initializer functions are provided that return <code>NdArray</code>s for common needs.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b> </th><th class="markdownTableHeadCenter"><b>NumCpp</b>  </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.linspace(1, 10, 5)</code> </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#a672fbcbd2271d5fc58bd1b94750bbdcc">nc::linspace</a>&lt;dtype&gt;(1, 10, 5)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.arange(3, 7)</code> </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#a465e2385ac78ca4cc23928a4a0cd9f53">nc::arange</a>&lt;dtype&gt;(3, 7)</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.eye(4)</code> </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#a944a26b6ffe66b39ab9ba6972906bf55">nc::eye</a>&lt;dtype&gt;(4)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.zeros([3, 4])</code> </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#a8fb3ecc9cc7448e4b5d3d422e499b10e">nc::zeros</a>&lt;dtype&gt;(3, 4)</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code><a class="el" href="classnc_1_1_nd_array.html" title="Holds 1D and 2D arrays, the main work horse of the NumCpp library.">nc::NdArray</a>&lt;dtype&gt;(3, 4) a = 0</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.ones([3, 4])</code> </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#ac9ffd1a2fa29857f39a38a9dab1079a2">nc::ones</a>&lt;dtype&gt;(3, 4)</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code><a class="el" href="classnc_1_1_nd_array.html" title="Holds 1D and 2D arrays, the main work horse of the NumCpp library.">nc::NdArray</a>&lt;dtype&gt;(3, 4) a = 1</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.nans([3, 4])</code> </td><td class="markdownTableBodyCenter"><code>nc::nans(3, 4)</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code><a class="el" href="classnc_1_1_nd_array.html" title="Holds 1D and 2D arrays, the main work horse of the NumCpp library.">nc::NdArray</a>&lt;double&gt;(3, 4) a = <a class="el" href="namespacenc_1_1constants.html#af94758715a9a5157d7ca95ab89d390ac" title="NaN.">nc::constants::nan</a></code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.empty([3, 4])</code> </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#a3da6e6c01236f9c2af8591a890f7d717">nc::empty</a>&lt;dtype&gt;(3, 4)</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code><a class="el" href="classnc_1_1_nd_array.html" title="Holds 1D and 2D arrays, the main work horse of the NumCpp library.">nc::NdArray</a>&lt;dtype&gt;(3, 4) a</code>  </td></tr>
</table>
<h3>SLICING/BROADCASTING</h3>
<p><b>NumCpp</b> offers <b>NumPy</b> style slicing and broadcasting.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b> </th><th class="markdownTableHeadCenter"><b>NumCpp</b>  </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>a[2, 3]</code> </td><td class="markdownTableBodyCenter"><code>a(2, 3)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>a[2:5, 5:8]</code> </td><td class="markdownTableBodyCenter"><code>a(<a class="el" href="classnc_1_1_slice.html" title="A Class for slicing into NdArrays.">nc::Slice(2, 5)</a>, <a class="el" href="classnc_1_1_slice.html" title="A Class for slicing into NdArrays.">nc::Slice(5, 8)</a>)</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code>a({2, 5}, {5, 8})</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>a[:, 7]</code> </td><td class="markdownTableBodyCenter"><code>a(a.rSlice(), 7)</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>a[a &gt; 5]</code> </td><td class="markdownTableBodyCenter"><code>a[a &gt; 50]</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>a[a &gt; 5] = 0</code> </td><td class="markdownTableBodyCenter"><code>a.putMask(a &gt; 50, 666)</code>  </td></tr>
</table>
<h3>RANDOM</h3>
<p>The random module provides simple ways to create random arrays.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b> </th><th class="markdownTableHeadCenter"><b>NumCpp</b>  </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.random.seed(666)</code> </td><td class="markdownTableBodyCenter"><code>nc::random::seed(666)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.random.randn(3, 4)</code> </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc_1_1random.html#aeffa74d48c1fb2603f83eaa358f17501">nc::random::randN</a>&lt;double&gt;(<a class="el" href="classnc_1_1_shape.html" title="A Shape Class for NdArrays.">nc::Shape(3,4)</a>)</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc_1_1random.html#aeffa74d48c1fb2603f83eaa358f17501">nc::random::randN</a>&lt;double&gt;({3, 4})</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.random.randint(0, 10, [3, 4])</code> </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc_1_1random.html#a43201ec4ec8e0c99041647ab45ac0133">nc::random::randInt</a>&lt;int&gt;(<a class="el" href="classnc_1_1_shape.html" title="A Shape Class for NdArrays.">nc::Shape(3,4)</a>,0,10)</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc_1_1random.html#a43201ec4ec8e0c99041647ab45ac0133">nc::random::randInt</a>&lt;int&gt;({3, 4},0,10)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.random.rand(3, 4)</code> </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc_1_1random.html#a0f5694167e15a8bc566a3fa6f842c3b4">nc::random::rand</a>&lt;double&gt;(<a class="el" href="classnc_1_1_shape.html" title="A Shape Class for NdArrays.">nc::Shape(3,4)</a>)</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc_1_1random.html#a0f5694167e15a8bc566a3fa6f842c3b4">nc::random::rand</a>&lt;double&gt;({3, 4})</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.random.choice(a, 3)</code> </td><td class="markdownTableBodyCenter"><code>nc::random::choice(a, 3)</code>  </td></tr>
</table>
<h3>CONCATENATION</h3>
<p>Many ways to concatenate <code>NdArray</code> are available.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b> </th><th class="markdownTableHeadCenter"><b>NumCpp</b>  </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.stack([a, b, c], axis=0)</code> </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#a656bb4b9fecf40f1f4194964be57c78b">nc::stack</a>({a, b, c}, <a class="el" href="namespacenc.html#a5edb9ac6f596ae1256faa3f5d797dc84a54c1ed33c810f895d48c008d89f880b7">nc::Axis::ROW</a>)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.vstack([a, b, c])</code> </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#a8dec1ff4db1d89ab4b3a7d32ff4b5cf3">nc::vstack</a>({a, b, c})</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.hstack([a, b, c])</code> </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#a80a6677582b65c19750b0d82ac182081">nc::hstack</a>({a, b, c})</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.append(a, b, axis=1)</code> </td><td class="markdownTableBodyCenter"><code>nc::append(a, b, nc::Axis::COL)</code>  </td></tr>
</table>
<h3>DIAGONAL, TRIANGULAR, AND FLIP</h3>
<p>The following return new <code>NdArray</code>s.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b> </th><th class="markdownTableHeadCenter"><b>NumCpp</b>  </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.diagonal(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::diagonal(a)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.triu(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::triu(a)</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.tril(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::tril(a)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.flip(a, axis=0)</code> </td><td class="markdownTableBodyCenter"><code>nc::flip(a, nc::Axis::ROW)</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.flipud(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::flipud(a)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.fliplr(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::fliplr(a)</code>  </td></tr>
</table>
<h3>ITERATION</h3>
<p><b>NumCpp</b> follows the idioms of the C++ STL providing iterator pairs to iterate on arrays in different fashions.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b> </th><th class="markdownTableHeadCenter"><b>NumCpp</b>  </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>for value in a</code> </td><td class="markdownTableBodyCenter"><code>for(auto it = a.begin(); it &lt; a.end(); ++it)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code>for(auto&amp; value : a)</code>  </td></tr>
</table>
<h3>LOGICAL</h3>
<p>Logical FUNCTIONS in <b>NumCpp</b> behave the same as <b>NumPy</b>.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b> </th><th class="markdownTableHeadCenter"><b>NumCpp</b>  </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.where(a &gt; 5, a, b)</code> </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#ac0af750215d0444ad9f0208620ca206b">nc::where</a>(a &gt; 5, a, b)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.any(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::any(a)</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.all(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::all(a)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.logical_and(a, b)</code> </td><td class="markdownTableBodyCenter"><code>nc::logical_and(a, b)</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.logical_or(a, b)</code> </td><td class="markdownTableBodyCenter"><code>nc::logical_or(a, b)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.isclose(a, b)</code> </td><td class="markdownTableBodyCenter"><code>nc::isclose(a, b)</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.allclose(a, b)</code> </td><td class="markdownTableBodyCenter"><code>nc::allclose(a, b)</code>  </td></tr>
</table>
<h3>COMPARISONS</h3>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b> </th><th class="markdownTableHeadCenter"><b>NumCpp</b>  </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.equal(a, b)</code> </td><td class="markdownTableBodyCenter"><code>nc::equal(a, b)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code>a == b</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.not_equal(a, b)</code> </td><td class="markdownTableBodyCenter"><code>nc::not_equal(a, b)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code>a != b</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>rows, cols = np.nonzero(a)</code> </td><td class="markdownTableBodyCenter"><code>auto [rows, cols] = nc::nonzero(a)</code>  </td></tr>
</table>
<h3>MINIMUM, MAXIMUM, SORTING</h3>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b> </th><th class="markdownTableHeadCenter"><b>NumCpp</b>  </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.min(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::min(a)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.max(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::max(a)</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.argmin(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::argmin(a)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.argmax(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::argmax(a)</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.sort(a, axis=0)</code> </td><td class="markdownTableBodyCenter"><code>nc::sort(a, nc::Axis::ROW)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.argsort(a, axis=1)</code> </td><td class="markdownTableBodyCenter"><code>nc::argsort(a, nc::Axis::COL)</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.unique(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::unique(a)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.setdiff1d(a, b)</code> </td><td class="markdownTableBodyCenter"><code>nc::setdiff1d(a, b)</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.diff(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::diff(a)</code>  </td></tr>
</table>
<h3>REDUCERS</h3>
<p>Reducers accumulate values of <code>NdArray</code>s along specified axes. When no axis is specified, values are accumulated along all axes.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b> </th><th class="markdownTableHeadCenter"><b>NumCpp</b>  </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.sum(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::sum(a)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.sum(a, axis=0)</code> </td><td class="markdownTableBodyCenter"><code>nc::sum(a, nc::Axis::ROW)</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.prod(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::prod(a)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.prod(a, axis=0)</code> </td><td class="markdownTableBodyCenter"><code>nc::prod(a, nc::Axis::ROW)</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.mean(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::mean(a)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.mean(a, axis=0)</code> </td><td class="markdownTableBodyCenter"><code>nc::mean(a, nc::Axis::ROW)</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.count_nonzero(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::count_nonzero(a)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.count_nonzero(a, axis=0)</code> </td><td class="markdownTableBodyCenter"><code>nc::count_nonzero(a, nc::Axis::ROW)</code>  </td></tr>
</table>
<h3>I/O</h3>
<p>Print and file output methods. All <b>NumCpp</b> classes support a <code><a class="el" href="namespacenc.html#aad1fad7ba0ba94b118bdceb29178488b">print()</a></code> method and <code>&lt;&lt;</code> stream operators.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b> </th><th class="markdownTableHeadCenter"><b>NumCpp</b>  </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>print(a)</code> </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#aad1fad7ba0ba94b118bdceb29178488b">a.print()</a></code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code>std::cout &lt;&lt; a</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>a.tofile(filename, sep=’\n’)</code> </td><td class="markdownTableBodyCenter"><code>a.tofile(filename, "\n")</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.fromfile(filename, sep=’\n’)</code> </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#ae299ba41f67aeade5634e93fd8b417c9">nc::fromfile</a>&lt;dtype&gt;(filename, "\n")</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.dump(a, filename)</code> </td><td class="markdownTableBodyCenter"><code>nc::dump(a, filename)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.load(filename)</code> </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#abec5f2e4d2a1598de762e32b839a3067">nc::load</a>&lt;dtype&gt;(filename)</code>  </td></tr>
</table>
<h3>MATHEMATICAL FUNCTIONS</h3>
<p><b>NumCpp</b> universal functions are provided for a large set number of mathematical functions.</p>
<h4>BASIC FUNCTIONS</h4>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b> </th><th class="markdownTableHeadCenter"><b>NumCpp</b>  </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.abs(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::abs(a)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.sign(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::sign(a)</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.remainder(a, b)</code> </td><td class="markdownTableBodyCenter"><code>nc::remainder(a, b)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.clip(a, 3, 8)</code> </td><td class="markdownTableBodyCenter"><code>nc::clip(a, 3, 8)</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.interp(x, xp, fp)</code> </td><td class="markdownTableBodyCenter"><code>nc::interp(x, xp, fp)</code>  </td></tr>
</table>
<h4>EXPONENTIAL FUNCTIONS</h4>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b> </th><th class="markdownTableHeadCenter"><b>NumCpp</b>  </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.exp(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::exp(a)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.expm1(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::expm1(a)</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.log(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::log(a)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.log1p(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::log1p(a)</code>  </td></tr>
</table>
<h4>POWER FUNCTIONS</h4>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b> </th><th class="markdownTableHeadCenter"><b>NumCpp</b>  </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.power(a, 4)</code> </td><td class="markdownTableBodyCenter"><code>nc::power(a, 4)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.sqrt(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::sqrt(a)</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.square(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::square(a)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.cbrt(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::cbrt(a)</code>  </td></tr>
</table>
<h4>TRIGONOMETRIC FUNCTIONS</h4>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b> </th><th class="markdownTableHeadCenter"><b>NumCpp</b>  </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.sin(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::sin(a)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.cos(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::cos(a)</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.tan(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::tan(a)</code>  </td></tr>
</table>
<h4>HYPERBOLIC FUNCTIONS</h4>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b> </th><th class="markdownTableHeadCenter"><b>NumCpp</b>  </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.sinh(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::sinh(a)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.cosh(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::cosh(a)</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.tanh(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::tanh(a)</code>  </td></tr>
</table>
<h4>CLASSIFICATION FUNCTIONS</h4>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b> </th><th class="markdownTableHeadCenter"><b>NumCpp</b>  </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.isnan(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::isnan(a)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.isinf(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::isinf(a)</code>  </td></tr>
</table>
<h4>LINEAR ALGEBRA</h4>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b> </th><th class="markdownTableHeadCenter"><b>NumCpp</b>  </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.linalg.norm(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::norm(a)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.dot(a, b)</code> </td><td class="markdownTableBodyCenter"><code>nc::dot(a, b)</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.linalg.det(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::linalg::det(a)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.linalg.inv(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::linalg::inv(a)</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.linalg.lstsq(a, b)</code> </td><td class="markdownTableBodyCenter"><code>nc::linalg::lstsq(a, b)</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.linalg.matrix_power(a, 3)</code> </td><td class="markdownTableBodyCenter"><code>nc::linalg::matrix_power(a, 3)</code>  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>Np.linalg.multi_dot(a, b, c)</code> </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc_1_1linalg.html#a86ab79e41b748e7ea0ee4f2e0bc462a6">nc::linalg::multi_dot</a>({a, b, c})</code>  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.linalg.svd(a)</code> </td><td class="markdownTableBodyCenter"><code>nc::linalg::svd(a)</code>  </td></tr>
</table>
</div></div><!-- PageDoc -->
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.17 </li>
  </ul>
</div>
</body>
</html>
